

<%@page import="beans.Hax"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
div.sub
{
	width:220px;
	padding:10px;
	border:5px solid gray;
	margin:0px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<jsp:useBean class="front.SubForum" id="s" scope="page"/>
<title>SubForum</title>
<c:set target="${s}" property="subForumID" value="${param.subForumID }"/>
<c:set var="threads" value="${s.threads}"/>
</head>
<body>
	<h2>${s.name}</h2>
	<small><a href="index.jsp" style="color:#000000">index</a> > ${s.name}</small><br>
	<td>
		<div style="float:right;margin-left:auto;margin-right:0px;">
			<%@ include file="LoginForm.jsp" %>
		</div>
		<div style="float:left;margin-left:0px;margin-right:auto;">
		<table border="1">
		<th>Thread</th>
		<th>Latest Post</th>
		<th>Replies</th>
		<th>Views</th>
		<c:forEach var="thread" items="${threads}">
			<tr>
				<td width = "200px" bgcolor="#F0F0F0">
					<a href="thread.jsp?subForumID=${param.subForumID}&threadID=${thread.threadID}" style="color:#000000;">
						<big>${thread.name}</big><br><small>${thread.creator.name}</small>
					</a>
				</td>
				<td width = "200px"bgcolor="E0E0E0">
						<small><nobr>${thread.latestPost.createdOn }</nobr><br><nobr>by: ${thread.latestPost.createdBy.name }</nobr></small>
				</td>
				<td width="40px" align="center" bgcolor="#F8F8F8">${thread.replies}</td>
				<td width="40px" align="center" bgcolor="#E0E0E0">${thread.views}</td>
			</tr>
		</c:forEach>
		</table>
		<c:if test="${not empty sessionScope.user}"><br>
			<FORM METHOD="POST" ACTION="createThread.jsp?subForumID=${param.subForumID }">
 					<INPUT TYPE="submit" VALUE="Create New Thread">
 			</FORM>
			
			<!--<c:if test="${sessionScope.user.userlvl} > -1 ">
				<a href="createThread.jsp?subForumID=${param.subForumID }">Create New Thread!</a>
			</c:if>-->
		</c:if>
		</div>
		
	</td>

</body>
</html>